<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" >	
		function checkit(obj) {
			if (obj.value.length > 5) {
				alert("太长了!!");
				return false;
			}
			return true;
		}
	</script>
</head>

<body>
	请输入：
	<input type="text" name="" maxlength="60" size="50"
		onkeyup="return checkit(this);" />
		<span id="qq"></span>
</body>
</html>
